var language=$("html").attr("lang");function compare(e,t){return e==t}function selectedObject(e){e.addClass("selected"),"fr"==language?e.append("selection active"):e.append("active selection")}function unselectObject(e){e.removeClass("selected"),e.children().remove()}function changementLangue(e){var t=$("html").attr("lang"),i=$(".changement-langue"),o=window.location.href.split("?")[1],a=o?"?"+o:"";if($('link[hreflang="fr"]').length>0&&$('link[hreflang="en"]').length>0){var n=$('[hreflang="fr"]').attr("href").replace(/.*\/\/[^\/]*/,""),l=$('[hreflang="en"]').attr("href").replace(/.*\/\/[^\/]*/,""),r="fr"===t?l:n;i.attr("href",r+a)}else if("undefined"!=typeof nom_du_theme){var s,h=e;h=h.replace("index.html","");var c=1===location.pathname.search("sefco2015")?"/sefco2015":"";""!==nom_du_theme&&(s=c+"/themes/"+nom_du_theme+"/localisation/menu-langage.json"),$.getJSON(s,function(e){for(var o in e){var n=e[o],l=n.length;if($.isArray(n))for(var r=0;r',l=new RegExp("img"),r=$(i[o]).html().toString();if(l.test(r)){var s=$(i[o]).find("img").attr("alt");null==s?($(i[o]).find("img").attr("alt",""+a),$(i[o]).find("img").attr("title",""+a)):($(i[o]).find("img").attr("alt",s+" "+a),$(i[o]).find("img").attr("title",s+" "+a))}else $(i[o]).append(n)}var h="fr"==t?"Ce lien mène à l'extérieur du site d'Hydro-Québec.":"This link will redirect you to an external site.",c=''+h+'',d=''+h+'';$(e).find("a[href^='http']:not([href*='hydroquebec.com'])").each(function(){var e=$(this),t=new RegExp("img"),i=e.html().toString();if(1!=$(e).hasClass("ignore_ext"))if(t.test(i)){var o=e.find("img").attr("alt");null==o?e.find("img").attr("alt",""+h):e.find("img").attr("alt",o+" "+h)}else e.append(c);1==$(e).hasClass("fond-blanc")&&e.append(d)})}function hqTooltips(){var e=$(".hq-tooltip"),t=$("body"),i="",o=["Fermer l’infobulle","Close tooltip"],a="fr"===$("html").attr("lang")?o[0]:o[1],n=t.data("tooltipsMobile")||"bulle";e.length&&e.each(function(e){var t=$(this),i=t.data(),o=void 0!==i.tooltipPrefixClass?i.tooltipPrefixClass+"-":"hq-tooltip-",a=e+1;t.attr({id:"label_tooltip_"+a}),t.wrap('')});t.on("click",function(e){var t=$(e.target);t.is(".hq-dialogtooltip")||t.is(".hq-tooltip")||t.parents(".hq-dialogtooltip").is(".hq-dialogtooltip")||$(".hq-dialogtooltip").remove()}).on("click",".hq-tooltip",function(e){var t,o=$(this),r=o.data(),s=void 0!==r.tooltipPrefixClass?r.tooltipPrefixClass+"-":"hq-tooltip",h=r.tooltipText||"",c=void 0!==r.tooltipContentId?"#"+r.tooltipContentId:"",d=(r.tooltipTitle,r.tooltipCloseText,r.tooltipCloseTitle||r.tooltipCloseText,o.attr("id")),p=void 0!==r.tooltipWidth?"hq-tooltip-"+r.tooltipWidth:"";$("#hq-tooltip").remove(),$(".hq-tooltip").removeClass("is-active"),t='",setTimeout(function(){"fullscreen"===n?$(t).appendTo("body"):$(t).insertAfter(o)},50),$("#"+d).addClass("is-active"),i=o,setTimeout(function(){l()},53),e.preventDefault()}).on("mouseleave","#hq-tooltip",function(e){var t=$(this),i=t.data(),o=(i.launchedBy,$("#"+i.focusBack));t.find(".tooltip-close").click(),o.removeClass("is-active")}),t.on("click","#hq-tooltip-close",function(e){var t=$(this),i=(t.parents("#hq-tooltip").attr("data-launched-by"),$("#"+t.attr("data-focus-back")));$("#hq-tooltip").remove(),$("body").removeClass("remove-scrollbars"),i.removeClass("is-active")}).on("keydown","#hq-tooltip",function(e){var t=$(this);if(27==e.keyCode&&($("#hq-tooltip-close").click(),e.preventDefault()),9==e.keyCode){var i=t.find("*").filter("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter(":visible"),o=$(document.activeElement),a=i.length,n=i.index(o);e.shiftKey||n!=a-1||(i.get(0).focus(),e.preventDefault()),e.shiftKey&&0==n&&(i.get(a-1).focus(),e.preventDefault())}});var l=function(){var e=$(window),t={top:e.scrollTop(),left:e.scrollLeft()},o=$("#hq-tooltip"),a=i,l=!0,r=(window.innerHeight,window.innerWidth);if($(window).width()>=767&&(l=!1),l)if($("#hq-tooltip").find(".hq-tooltip-arrow-up").hide(),"fullscreen"===n){var s="0",h=t.top,c=0;$("body").addClass("remove-scrollbars")}else s="1%",h=a.offset().top-o.outerHeight()-t.top,c=a.offset().left+a.outerWidth()/2-10;else{var d=(s=a.offset().left+a.outerWidth()/2-o.outerWidth()/2)+o.outerWidth();h=a.offset().top-o.outerHeight()-t.top,s<32?s=32:d>r&&(s=r-(o.outerWidth()+32)),h<=0?(h=h+o.outerHeight()+22,$("#hq-tooltip").find(".hq-tooltip-arrow-up").show(),$("#hq-tooltip").find(".hq-tooltip-arrow").hide()):($("#hq-tooltip").find(".hq-tooltip-arrow-up").hide(),$("#hq-tooltip").find(".hq-tooltip-arrow").show()),c=a.offset().left+a.outerWidth()/2-s}$("#hq-tooltip").find(".hq-tooltip-arrow").css({left:c}),$("#hq-tooltip").find(".hq-tooltip-arrow-up").css({left:c}),$(o).css({left:s,top:h})};$(window).on("resize",function(){$("#hq-tooltip:visible").length>0&&l()}),$(window).scroll($.debounce(50,!0,function(){$("#hq-tooltip:visible").length>0&&function(){var e=$(window),t={top:e.scrollTop()},o=$("#hq-tooltip"),a=i,l=(window.innerHeight,o.height(),!0);if($(window).width()>=767&&(l=!1),"fullscreen"===n&&l)var r=t.top;else Interval.set(function(){r=a.offset().top-o.outerHeight()-e.scrollTop(),l?($("#hq-tooltip").find(".hq-tooltip-arrow-up").hide(),r=a.offset().top-o.outerHeight()-e.scrollTop(),o.css({top:r})):r<=0?(r=r+o.outerHeight()+22,$("#hq-tooltip").find(".hq-tooltip-arrow-up").show(),$("#hq-tooltip").find(".hq-tooltip-arrow").hide()):($("#hq-tooltip").find(".hq-tooltip-arrow-up").hide(),$("#hq-tooltip").find(".hq-tooltip-arrow").show()),o.css({top:r})},10);o.css({top:r})}()})),$(window).scroll($.debounce(250,function(){Interval.clearAll()}))}$(function(){function e(e){$(e).collapse({accordion:!0,open:function(){this.stop(!0,!0),this.slideDown(400);var e=$(this.context).parent();e.hasClass("tabs")&&$(window).width()<912&&$("html, body").animate({scrollTop:e.offset().top},200)},close:function(){this.stop(!0,!0),this.slideUp(400)}})}function t(e){$(e).collapse({accordion:!1,open:function(){this.stop(!0,!0),this.slideDown(400)},close:function(){this.stop(!0,!0),this.slideUp(400)}})}function i(e){$(e).collapse({open:function(){this.stop(!0,!0),this.slideDown(400);var e=$(this.context);e.width()<=733&&$("html, body").animate({scrollTop:e.offset().top},200)},close:function(){this.stop(!0,!0),this.slideUp(400)}}),$(".hq-mega-collapse").find("button").each(function(e){$(this).unbind("click"),$(this).click(function(e){e.target==e.currentTarget&&$("a",$(this)).click()})})}svg4everybody(),hqTooltips(),$(document).ready(function(){!function(){var e=location.hash.replace("#","");if(e){var t=$("#"+e);if(t.parent(".hq-collapse").length>0){var i=t.closest(".collapse-content").prev(".collapse-banner"),o=t.children("a");t.hasClass("open")||o.click(),i&&i.click(),$("html, body").animate({scrollTop:o.offset().top},600)}else t.hasClass("collapse-banner")?(t.click(),$("html, body").animate({scrollTop:t.offset().top},600)):"false"==n().scroll&&"undefined"!=n().scroll||$("html, body").animate({scrollTop:$("#"+e).offset().top},600)}}()}),$(".changement-langue").length&&changementLangue(location.pathname),$("#hq-header-nav-section2").hasClass("hq-menu-site-2014")?$("#hq-main-header").addClass("hq-menu-site-2014-bloc"):$("#hq-main-header").addClass("hq-menu-site-new-bloc"),$(".hq-collapse").not($('.all-open, .hq-collapse[data-collapse-allopen="true"]')).each(function(t,i){e($(i))}),$("body").on("ready",'.hq-collapse:not(.all-open, .hq-collapse[data-collapse-allopen="true"])',function(t){e($(t.currentTarget))}),$('.hq-collapse.all-open, .hq-collapse[data-collapse-allopen="true"]').each(function(e,i){t($(i))}),$("body").on("ready",'.hq-collapse.all-open, .hq-collapse[data-collapse-allopen="true"]',function(e){t($(e.currentTarget))}),$(".hq-mega-collapse").each(function(e,t){i($(t))}),$("body").on("ready",".hq-mega-collapse",function(e){i($(e.currentTarget))});var o="fr"===language?"Ouvrir pour plus d'information.":"Open for more information",a="fr"===language?"Fermer le contenu":"Close the content";function n(e){var t=e?e.split("?")[1]:window.location.search.slice(1),i={};if(t)for(var o=(t=t.split("#")[0]).split("&"),a=0;a
'+o+"
",lessLink:'",collapsedHeight:$(this).data("collapse-height")||300,speed:500,afterToggle:function(e,t,i){if(i){function o(){var e=t.children(".hq-bloc-ouvrir__inner");if(e.length>0){var i=e.height()+30;t.css("height",i)}}o(),t.on("click",".hq-collapse a",function(){setTimeout(function(){o()},400)})}}}),$(this).find(".hq-bloc-ouvrir__titre").length>0){var t=$(this).find(".hq-bloc-ouvrir__titre").text();$(this).siblings("div[data-readmore-toggle]").find("a > div").append(''+t+"")}}),$(".hq-bloc-ouvrir").on("click",".hq-collapse a",function(e){var t=$(e.target).closest(".hq-bloc-ouvrir");"false"===t.attr("aria-expanded")&&t.readmore("toggle")}),$('a[href*="#"]').not('[href="#"]').not('[href="#0"]').not('[href="#hq-formulaire"]').not('[href="#residentielPanel"]').not('[href="#affairesPanel"]').not('[href="#info-pannesPanel"]').not('[href="#residentialPanel"]').not('[href="#businessPanel"]').not('[href="#outagesPanel"]').click(function(e){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var t=$(this.hash);(t=t.length?t:$("[name="+this.hash.slice(1)+"]")).length&&(e.preventDefault(),$("html, body").animate({scrollTop:t.offset().top},1e3,function(){var e=$(t);if(e.focus(),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()}))}}),$("#hq-accueil-n1").find("a").removeClass("active-section"),$("img[data-href]").click(function(){var e=$(this).data("href");window.location=e});var l=$(".hq-onglets");if(l){var r=window.location.pathname,s=l.find('a[href*="'+r+'"]').parent("li")[0];r&&s?($(s).addClass("active"),"fr"==language?$(".active a").append('section en cours'):"en"===language&&$(".active a").append('active section')):$(l.find("li")[0]).addClass("active")}$("div[data-copy]").each(function(e,t){var i=$(this).data("copy"),o=$("#"+i).html();$(this).html(o)}),$("div[data-copy-selector]").each(function(e,t){var i=$(this).data("copy-selector"),o=$(i).html();$(this).html(o)}),$("div[data-cut]").each(function(e,t){var i=$(this).data("cut"),o=$("#"+i).html();$("#"+i).addClass("lecteur-ecran-seul"),$("#"+i).attr("id",i+"-coller"),$(this).attr("id",i),$(this).html(o)});var h=$("div[data-header-settings]");if(h.length>0){var c={hideUtils:h.attr("hide-utils")||!1,hideLien:h.attr("hide-lien")||!1,hideLangue:h.attr("hide-langue")||!1,hideConnecter:h.attr("hide-connecter")||!1,urlConnecter:h.attr("url-connecter")||!1,labelConnecter:h.attr("label-connecter")||!1,hideReseaux:h.attr("hide-reseaux")||!1,lienUrl:h.attr("lien-url")||!1,lienLabel:h.attr("lien-label")||!1,logoURL:h.attr("logo-url")||!1,logoLabel:h.attr("logo-label")||!1,logoImg:h.attr("logo-img")||!1};c.hideUtils&&($("#hq-main-header .hq-nav-utils").remove(),$("#hq-menu-visible-mobile").remove(),$("#hq-main-header .hq-header-trio-bloc").addClass("paddingtop-20")),(c.logoURL||c.logoLabel||c.logoImg)&&($("#hq-main-header .hq-logo a").attr("href",c.logoURL),$("#hq-main-header .hq-logo img").attr("src",c.logoImg).attr("alt",c.logoLabel)),!c.hideLien&&c.lienUrl&&c.lienLabel?$("#hq-main-header .hq-accueil a").attr("href",c.lienUrl).text(c.lienLabel):$("#hq-main-header .hq-accueil").remove(),c.hideConnecter&&$("#hq-main-header .hq-connexion").remove(),c.urlConnecter&&c.labelConnecter?($("#hq-main-header .hq-connexion a").attr("href",c.urlConnecter),$("#hq-main-header .hq-connexion .label-connecter").text(c.labelConnecter)):"fr"==language?($("#hq-main-header .hq-connexion a").attr("href","https://session.hydroquebec.com/portail/fr/group/clientele/gerer-mon-compte"),$("#hq-main-header .hq-connexion .label-connecter").text("Me connecter")):($("#hq-main-header .hq-connexion a").attr("href","https://session.hydroquebec.com/portail/en/group/clientele/gerer-mon-compte"),$("#hq-main-header .hq-connexion .label-connecter").text("Log-in")),c.hideLangue&&($("#hq-main-header .hq-langue").remove(),$("#hq-menu-visible-mobile .changement-langue").parent().remove()),c.hideReseaux&&$("#hq-main-header .sn-reseaux").remove()}}),function(e,t,i,o,a){"use strict";var n;t.extend({init:function(i){return t.extend(e,i)}}).fn.extend({changementLanguev2:function(o){var a=t("html").attr("lang"),l=(t(".changement-langue"),i.location.href.split("?")[1]),r=l?"?"+l:"";if(t('link[hreflang="fr"]').length>0&&t('link[hreflang="en"]').length>0){var s=t('[hreflang="fr"]').attr("href").replace(/.*\/\/[^\/]*/,""),h=t('[hreflang="en"]').attr("href").replace(/.*\/\/[^\/]*/,""),c="fr"===a?h:s;o=t.extend({},e,o),t(this).find(o.selector).each(function(){t(this).attr("href",c+r)})}else if("undefined"!=typeof nom_du_theme){var d,p=location.pathname;n=p.replace("index.html","");var f=1===p.search("sefco2015")?"/sefco2015":"";""!==nom_du_theme&&(d=f+"/themes/"+nom_du_theme+"/localisation/menu-langage.json"),o=t.extend({},e,o),t(this).find(o.selector).each(function(){var e=t(this);return t.getJSON(d,function(i){for(var o in i){var l=i[o],s=l.length;if(t.isArray(l))for(var h=0;h=1){for(t="
    ",i=0,o=e.itemListElement.length;i"+e.itemListElement[i].item.name+"";t+="
",a.innerHTML=t}}function generateBreadcrumbSpan(){var e,t,i,o,a=document.getElementById("hq-breadcrumb");if((e=JSON.parse($('script[type="application/ld+json"]').text())).itemListElement.length>=1){for(o="",t=0,i=e.itemListElement.length;t"+e.itemListElement[t].item.name+" ";a.innerHTML=o}}$.fn.isOnScreen=function(e,t){null==e&&(e=1),null==t&&(t=1);var i=$(window),o={top:i.scrollTop(),left:i.scrollLeft()};o.right=o.left+i.width(),o.bottom=o.top+i.height();var a=this.outerHeight(),n=this.outerWidth();if(!n||!a)return!1;var l=this.offset();return l.right=l.left+n,l.bottom=l.top+a,console.log(l.right),!(o.rightl.right||o.bottoml.bottom)&&{top:Math.min(1,(l.bottom-o.top)/a),bottom:Math.min(1,(o.bottom-l.top)/a),left:Math.min(1,(l.right-o.left)/n),right:Math.min(1,(o.right-l.left)/n)}},$.fn.animTuiles=function(){var e=$(this);e.find('li[role="tab"]').each(function(a,n){var l=$(this);l.find("a").on("tapstart",function(i){return!!$(this).parent("li").hasClass("hq-tuile-hover")||(t(e),!1)}),l.on("tapend mouseenter focusin",function(){(e=$(this)).find("figure").addClass("hq-remove"),e.addClass("hq-tuile-hover"),i(e,a)}).on("mouseleave focusout",function(){(e=$(this)).removeClass("hq-tuile-hover"),e.find("figure").removeClass("hq-remove"),o(e)})});var t=function(t,i){$(t).parent().find("li").removeClass("hq-tuile-adj"),e.removeClass("hq-tuile-hover"),e.find("figure").removeClass("hq-remove")},i=function(e,t){if(0===(t=(t+1)%3)){var i=$(e).prevAll().eq(2);$(e).prevUntil(i).addClass("hq-tuile-adj")}else 1==t?($(e).next("li").addClass("hq-tuile-adj"),$(e).next("li").next("li").addClass("hq-tuile-adj")):($(e).prev("li").addClass("hq-tuile-adj"),$(e).next("li").addClass("hq-tuile-adj"))},o=function(e){$(e).parent().find("li").removeClass("hq-tuile-adj")}},$('[data-module="bar-graph-horizontal"]').each(function(){var e=$(this).find(".valeur"),t=0;e.each(function(){var e=parseInt($(this).text());e>t&&(t=e)}),e.each(function(){var e=parseInt($(this).text()),i=parseInt(e/t*78),o=$(this).is(".winner")?"calc("+i+"% + 4px)":i+"%";$(this).css("width",o)})}),function(){function e(){""==this.f_name&&(this.f_name=this.f_ref);var e=this.response;window.navigator.msSaveBlob(e,this.f_name)}function t(t){t.preventDefault();var i=new XMLHttpRequest;i.f_name=this.getAttribute("download"),i.f_ref=this.getAttribute("href"),i.addEventListener("load",e,!1),i.open("get",this,!0),i.responseType="blob",i.send()}$(window).load(function(){if(!!document.documentMode)for(var e=document.querySelectorAll("a[download]"),i=0;i')})});